/*
 *  matrix.h
 *  Renderbunny
 *
 *  Created by Holmes Futrell on 1/21/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef MATRIX
#define MATRIX

#define M4E(row, col) ( (row) + 4 * (col) )
#define M3E(row, col) ( (row) + 3 * (col) )

#include "vector.h"
#include "math.h"

typedef struct {
	float entries[16];
} mat4;
	
typedef struct {
	float entries[9];
} mat3;

// prints out the matrix
void rb_describe_mat4(mat4 mat);

mat4 rb_mat4_inverse( const mat4 *mat );
mat4 rb_mat4_transpose( const mat4 *mat );

mat3 rb_mat3_from_mat4( mat4 mat );
mat4 rb_mat4_from_mat3( mat3 mat );

mat4 rb_mat4_zero(void);
mat4 rb_mat4_translate(vec3 t);
mat4 rb_mat4_identity();

mat4 rb_mat4_mul( mat4 a, mat4 b);


#endif